// 参数加密
export const encodeParams = (params) => {
  return btoa(encodeURIComponent(JSON.stringify(params)));
};

// 参数解密
export const decodeParams = (str) => {
  try {
    return JSON.parse(decodeURIComponent(atob(str)));
  } catch (e) {
    console.error("解析参数错误:", e);
    return {};
  }
};
